package com.pond.pond.service.impl;

import com.pond.common.core.utils.DateUtils;
import com.pond.pond.domain.FishingTechniqueComment;
import com.pond.pond.mapper.FishingTechniqueCommentMapper;
import com.pond.pond.service.IFishingTechniqueCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 钓技文章评论Service业务层处理
 * 
 * @author pond
 * @date 2024-01-15
 */
@Service
public class FishingTechniqueCommentServiceImpl implements IFishingTechniqueCommentService 
{
    @Autowired
    private FishingTechniqueCommentMapper fishingTechniqueCommentMapper;

    /**
     * 查询钓技文章评论
     * 
     * @param id 钓技文章评论主键
     * @return 钓技文章评论
     */
    @Override
    public FishingTechniqueComment selectFishingTechniqueCommentById(Long id)
    {
        return fishingTechniqueCommentMapper.selectFishingTechniqueCommentById(id);
    }

    /**
     * 查询钓技文章评论列表
     * 
     * @param fishingTechniqueComment 钓技文章评论
     * @return 钓技文章评论
     */
    @Override
    public List<FishingTechniqueComment> selectFishingTechniqueCommentList(FishingTechniqueComment fishingTechniqueComment)
    {
        return fishingTechniqueCommentMapper.selectFishingTechniqueCommentListForAdmin(fishingTechniqueComment);
    }

    /**
     * 新增钓技文章评论
     * 
     * @param fishingTechniqueComment 钓技文章评论
     * @return 结果
     */
    @Override
    public int insertFishingTechniqueComment(FishingTechniqueComment fishingTechniqueComment)
    {
        fishingTechniqueComment.setCreateTime(DateUtils.getNowDate());
        return fishingTechniqueCommentMapper.insertFishingTechniqueComment(fishingTechniqueComment);
    }

    /**
     * 修改钓技文章评论
     * 
     * @param fishingTechniqueComment 钓技文章评论
     * @return 结果
     */
    @Override
    public int updateFishingTechniqueComment(FishingTechniqueComment fishingTechniqueComment)
    {
        fishingTechniqueComment.setUpdateTime(DateUtils.getNowDate());
        return fishingTechniqueCommentMapper.updateFishingTechniqueComment(fishingTechniqueComment);
    }

    /**
     * 批量删除钓技文章评论
     * 
     * @param ids 需要删除的钓技文章评论主键
     * @return 结果
     */
    @Override
    public int deleteFishingTechniqueCommentByIds(Long[] ids)
    {
        return fishingTechniqueCommentMapper.deleteFishingTechniqueCommentByIds(ids);
    }

    /**
     * 删除钓技文章评论信息
     * 
     * @param id 钓技文章评论主键
     * @return 结果
     */
    @Override
    public int deleteFishingTechniqueCommentById(Long id)
    {
        return fishingTechniqueCommentMapper.deleteFishingTechniqueCommentById(id);
    }
}